import axios from "axios";

const API_KEY = "pat_KLyIqCxd6A6zHRuo1SpTQerulodO3hVBpseL6mSZiumEMfRsSyzy6mY8EMxhcA0F";

export const getCozeMessage = async (input: string, id: number) => {
    const headers = {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${API_KEY}`
    }
    const data = {
        bot_id: "7399607874722791462",
        user: "kl",
        query: `${input},id=${id}`,
        stream: false
    }
    const res = await axios.post('https://api.coze.cn/open_api/v2/chat', data, {
        headers
    })
    return res.data
}